

#pragma once

#include "gamedatamanager.h"

#include "cocos2d.h"
USING_NS_CC;

class FrameAnimation;

class ArmiesScene : public CCScene, public CCKeypadDelegate {
public:
	ArmiesScene();
	virtual ~ArmiesScene();

    CREATE_FUNC(ArmiesScene);

private:
	virtual bool init();
	void update(float dt);

	void onPlayCampaign(CCObject* sender);
	void onStartBattle(CCObject* sender);
	void onEditFormation(CCObject* sender);
	void onViewCollection(CCObject* sender);
	void onEditFlag(CCObject* sender);
	void onBack(CCObject *sender);
	void onOpenShop(CCObject* sender);
	void onRecharge(CCObject* sender);

	void onTestBattle(CCObject *sender);
	void onTestBattle2(CCObject *sender);

	void updateFormationPreviews();

	virtual void onEnter() override;
	virtual void onExit() override;

	virtual void keyBackClicked();
	virtual void keyMenuClicked();

private:
	CCLayer* _layer;

	CCMenuItemSprite* _formationPreviews[FORMATION_COUNT];

	CCLabelTTF* _labelMoney;

	bool _initialized;
	char buf[300];
};
